package company.jd_F;

import java.util.Scanner;

public class JD1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        StringBuffer sb = new StringBuffer("2");
        for (int i = 1; i < n; i++) {
            System.out.println(sb);
            sb = next(sb);
        }
        System.out.println(sb);
    }

    private static StringBuffer next(StringBuffer sb) {
        int n = sb.length();
        for (int i = n - 1; i >= 0; i--) {
            if (sb.charAt(i) != '5') {
                if (sb.charAt(i) == '2') {
                    sb.setCharAt(i, '3');
                    for (int j = i + 1; j < n; j++) {
                        sb.setCharAt(j, '2');
                    }
                } else if (sb.charAt(i) == '3') {
                    sb.setCharAt(i, '5');
                    for (int j = i + 1; j < n; j++) {
                        sb.setCharAt(j, '2');
                    }
                }
                return sb;
            }
        }
        StringBuffer tmp = new StringBuffer();
        for (int i = 0; i <= n; i++) {
            tmp.append(2);
        }
        return tmp;
    }
}
